package com.example.demo.javaTest;

import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Logs {
    public static final Logger LOGGER = LoggerFactory.getLogger("LogbackTest");

    @Test
    public void testLogback() {
        try {
            LOGGER.info("方法开始执行");
            chu(10,1);
            LOGGER.info("方法执行成功");
        } catch (Exception e) {
            LOGGER.error("方法执行失败");
            e.printStackTrace();
        }
    }

    public static void chu(int a, int b) {
        LOGGER.debug("参数a:"+a);
        LOGGER.debug("参数b:"+b);
        int c = a / b;
        LOGGER.info("结果是:"+c);
    }
}
